package com.techfort.metalrss;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.webkit.WebView;

public class ViewFeed extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		WebView wv = new WebView(this);
		setContentView(wv);
		
		Bundle extras = this. getIntent().getExtras();
		String data = extras.getString("DATA");
		wv.setBackgroundDrawable(getResources().getDrawable(R.drawable.metal));
		wv.loadData(data, "text/html", "UTF-8");
		
	
	}

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    	
    	MenuInflater mi = new MenuInflater(this);
    	mi.inflate(R.menu.menu, menu);
    	return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	switch(item.getItemId()){
    	case R.id.favourites:
    		Intent intent = new Intent(ViewFeed.this, Favourites.class);
    		startActivity(intent);
    	case R.id.home:
    		Intent home = new Intent(ViewFeed.this, Main.class);
    		startActivity(home);
    	default:
    		return true;
    	}
    }
}
